const http = require('http');

const server = http.createServer((request,response)=> {
    //创建一个url对象
    let url = new URL(request.url,'http://localhost:9000');
    console.log(url);
    //获得请求路径
    console.log(url.pathname);
    //获得参数值
    console.log(url.searchParams.get('name'));
    response.end('url new');
});
server.listen(9000,() => {
    console.log("服务已经启动 9000端口正在监听....");
});